<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport"	content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css?v=1">
		<link href="${pageContext.request.contextPath}/bettery/css/itao.css"	rel="stylesheet" />
		<script type="text/javascript" src="${pageContext.request.contextPath}/dewei/js/jquery.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/bettery/js/jquery.validate.min.js"></script>
		<script type="text/javascript" src='${pageContext.request.contextPath}/dewei/js/jquery-ui-datepicker.min.js'></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/bettery/js/bettery_common.js"></script>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dewei/css/calendar.css">
		<script type="text/javascript"	src="${pageContext.request.contextPath}/bettery/js/template.js"></script>
		
		<script src="${pageContext.request.contextPath}/bettery/js/mobiscroll.core.js"></script>
        <script src="${pageContext.request.contextPath}/bettery/js/mobiscroll.widget.js" type="text/javascript"></script>
        <script src="${pageContext.request.contextPath}/bettery/js/mobiscroll.scroller.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/bettery/js/mobiscroll.datetime.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/bettery/js/mobiscroll.widget.android.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/bettery/js/mobiscroll.i18n.zh.js" type="text/javascript"></script>
		
	   <link href="${pageContext.request.contextPath}/bettery/css/mobiscroll.icons.css" rel="stylesheet" type="text/css" />
       <link href="${pageContext.request.contextPath}/bettery/css/mobiscroll.widget.css" rel="stylesheet" type="text/css" />
       <link href="${pageContext.request.contextPath}/bettery/css/mobiscroll.widget.android.css" rel="stylesheet" type="text/css" />
       <link href="${pageContext.request.contextPath}/bettery/css/mobiscroll.scroller.css" rel="stylesheet" type="text/css" />
       <link href="${pageContext.request.contextPath}/bettery/css/mobiscroll.scroller.android.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			.slide .inner-scroll{
				left: 0px;top: 0px;height: 100%;overflow-y:auto;
			}
			.bx-wrapper div.footer_bar{
				position: absolute;bottom: 0px;
			}
			select{
			border:none;background:none;
			}
			a:hover{
			text-decoration: none;
			}
		</style>
	</head>
	<body onload="hideLoading()">
	<div id="calendar"	style="text-align: center; height: 0px; z-index: 999;; margin-top: 20px; display: none;position: absolute;left: 10px;top: 60px"	align="center"></div>
	    <form id='searchForm' action="toConfirm.do"  method="post">
	    <input type="hidden" id="nowDate" value="${nowDate}" />
	    <input type="hidden" id="nowHour" value="${nowHour}" />
			<input type="hidden" value="${model.lat}" name='model.lat' id="hiddenLat"/>
			<input type="hidden" value="${model.lng}" name='model.lng' id="hiddenLng"/>
			<input type="hidden" value="${model.blat}" name='model.blat' id="hiddenbLat"/>
			<input type="hidden" value="${model.blng}" name='model.blng' id="hiddenbLng"/>
			<input type="hidden" value="${model.chexingId}" id="chexingId" name="model.chexingId"/>
			<input type="hidden" value="${model.chexingName}" name="model.chexingName"   id="hiddenChexingName"/>
			<!-- 下订单人所在的省市县 -->
		    <input type="hidden" value="${model.province}" name='model.province' class="hiddenProvince"  id="hiddenProvince"/>
		    <input type="hidden" value="${model.city}" name='model.city' class="hiddenCity" id="hiddenCity"/>
		    <input type="hidden" value="${model.town}" name='model.town' class="hiddenTown" id="hiddenTown"/>
		    <!-- 电池 -->
			<input type="hidden" value="${model.dianchiId}" name="model.dianchiId" id="dianchiId"/>
			<input type="hidden" value="${model.price}" name='model.price' id="ourPrice"/>
			<input type="hidden" value="${model.pinPai}" name='model.pinPai' id="pinPai"/>
			<input type="hidden" value="${model.xingHao}" name='model.xingHao' id="xingHao"/>
			<input type="hidden" value="${model.imageUrl}" name='model.imageUrl' id="imageUrl"/>
			
			<input type="hidden" value="${model.zhongliang}" name='model.zhongliang' id="bettery_zhongliang"/>
			<input type="hidden" value="${model.licheng}" name='model.licheng' id="bettery_licheng"/>
		    <input type="hidden" value="${model.detailInfo}" name='model.detailInfo' id="bettery_detailInfo"/>
		    <input type="hidden" value="${model.marketPrice}" name='model.marketPrice' id="bettery_marketPrice"/>
		    <input type="hidden" value="${model.serverPrice}" name='model.serverPrice' id="bettery_serverPrice"/>
			<!-- 1:门店，2：上门 -->
			<input type="hidden" name='model.changeType' value="人工上门更换" id="hiddenChangeType"/>
			
			<!-- 门店地址 -->
			<input type="hidden" value="${model.mendianAddr}" name='model.mendianAddr' id="hiddenmendianAddr"/>
			<input type="hidden" value="${model.mendianId}" name='model.mendianId' id="hiddenMendianId"/>
			<!-- 门店联系电话 -->
			<input type="hidden" value="${model.menDianTel}" name='model.menDianTel' id="hiddenMenDianTel"/>
			<input type="hidden" value="${model.mendianLxr}" name='model.mendianLxr' id="hiddenMendianLxr"/>
			<input type="hidden" value="${model.mendianName}" name='model.mendianName' id="hiddenMendianName"/>
		    <input type="hidden" id="tsss">
		<div class="search_bar" style="" align="center">
		<span class='new-btn left'><a onclick="back();">返回</a></span>
		请填写您的联系方式
		<span class="new-btn right"><a onclick="javascript:submitdingdan();">确定</a></span>
		</div>
		<div class='tips'>备注：人工上门更换每次加收${model.serverPrice}元服务费。</div>
		<div  class="col-lg-12 m-t">
			<div class='panel'>
			<div class='panel-body'>
			<div class='form-group'>
				<label class='form-caption'><font color="red">*</font>姓名</label>
				<input type="text" id="shangmenName" name="model.kehuName" value="${model.kehuName}" maxlength="30" class="form-control" placeholder="姓名"> 
				<label  class="error" for="shangmenName"></label>
			</div>
			<div class='form-group'>
				<label class='form-caption'><font color="red">*</font>手机号</label>
				<input type="text" id="shangmenTel" name="model.lxTel" value="${model.lxTel}" maxlength="11" class="form-control" placeholder="手机号"> 
				<label class="error" for="shangmenTel"></label>
			</div>
			<div class='form-group'>
				<label class='form-caption'><font color="red">*</font>预约上门地址</label>
				<div class="input-group">
				  <input type="text" id="shangmenAddress" name="model.address" value="${model.address}" maxlength="100" class="form-control address" placeholder="地址" >
				  <span class="input-group-addon" onclick="autoAddr();"><img src='../dewei/img/loc.png' width='18px'> </span>
				</div>
				<label class="error" for="shangmenAddress"></label>
			</div>
			<div class='form-group'>
				<label class='form-caption'><font color="red">*</font>预约上门时间</label>
				<input name="model.time" value="${model.time}"  id="test" class="demo-test-date demo-test-datetime demo-test-time demo-test-credit form-control" placeholder="预约上门时间" />
				<label class="error" for="test"></label>
			</div>
				
			</div>
			</div>
		</div>
		</form>
		<script type="text/javascript">
		$(function(){
			jQuery.validator.addMethod("mobilePhone", function(value, element) {var length = value.length;var tel = /^((1[3|4|5|8]{1}[0-9]{1})+\d{8})$/;return this.optional(element) || (length == 11 && tel.test(value));}, "格式错误 ");
			validator = $("#searchForm").validate({
				rules : {
					"model.kehuName" : {
						required : true
					},
					"model.lxTel" : {
						required : true,
						mobilePhone:true
					},
					"model.address":{
					    required : true	
					},
					"model.time":{
					    required : true
					}
				},
				messages : {
					"model.kehuName" : {
						required : "请填写您的姓名"
					},
					"model.lxTel" : {
						required : "请填写您的联系方式"
					},
					"model.address":{
					    required : "请填写您的地址"
					},
					"model.time":{
					    required : "必选"
					}
				}
			});
			var shangmenHour='${shangmenHour}';
			var shangmenMuni='${shangmenMuni}';
			var curr = new Date();
			var nowDate='${nowDate} ${nowHour}';

			if(nowDate){
				nowDate = nowDate.replace(/-/g,"/");
			    curr = new Date(nowDate );
			}
			var year = curr.getFullYear();
			var month = curr.getMonth()+1;
			var day = curr.getDate();
			var endDate = new Date(year, month, day, 0, 0);
            var opt = {
                'datetime': {
                    preset: 'datetime',
                    minDate: curr,
                    maxDate: endDate,
                    dateFormat: 'yy-mm-dd',
                    stepMinute: 15
                }
            };
            $('#test').focus(function() {
                $('.demo-test-datetime').scroller('destroy').scroller($.extend(opt['datetime'], {
                    theme: 'android',
                    mode: 'datetime',
                    lang: 'zh',
                    display: 'modal',
                    animate: ''
                })
				);
                $('.demo-datetime').show();
            });
            $("#test").blur(function(){
            	validator.form();
            });
            
		});
		</script>
	</body>
</html>